﻿@model SchoolCommunicationSystem.Models.CreatePrivateMessageViewModel

@{
    ViewBag.Title = "Nội dung tin nhắn";
    SCS.Business.MembershipService _membershipServices = new SCS.Business.MembershipService();
    string userName = User.Identity.Name;
    var user = _membershipServices.GetUser(userName);
    if (user.MembershipRoles.FirstOrDefault().roleID == 2)
    {
        Layout = "~/Views/Shared/_ParentsLayout.cshtml";
    }
    else
    {
        Layout = "~/Views/Shared/_TeacherLayout.cshtml";
    }
}
   <script src="/Scripts/jquery-ui-1.8.11.min.js" type="text/javascript"></script>
<link href="@Url.Content("~/Content/jquery.cleditor.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery.cleditor.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.cleditor.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/autocomplete.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () { $("#Message").cleditor(); });
</script>

<div id="page-heading">
    <h1>Soạn Tin Nhắn</h1>
</div>
<div class="container">
    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h4>@ViewBag.Title</h4>
                </div>
                <div class="panel-body">
                    @using (Html.BeginForm("Create", "PrivateMessage", FormMethod.Post, new { @class = "form-horizontal" }))
                    {
                        @Html.ValidationSummary(true)
                        @Html.AntiForgeryToken()
                        <div class="form-group">
                            @Html.LabelFor(model => model.UserToUsername, new { @class = "col-sm-2" })
                            <div class="col-sm-3">
                                @Html.TextBoxFor(m => m.UserToUsername, new { data_autocomplete_url = Url.Action("AutoComplete", "PrivateMessage") })
                            </div>
                            <div class="col-sm-3">
                                @Html.ValidationMessageFor(model => model.UserToUsername)
                            </div>
                        </div>
                        <div class="form-group">
                            @Html.LabelFor(model => model.Subject, new { @class = "col-sm-2" })
                            <div class="col-sm-3">
                                @Html.EditorFor(model => model.Subject)
                            </div>
                            <div class="col-sm-3">
                                @Html.ValidationMessageFor(model => model.Subject)
                            </div>
                        </div>
                        <div class="editor-field">
                            @Html.TextAreaFor(model => model.Message)
                            @Html.ValidationMessageFor(model => model.Message)
                        </div>
                        <br />
                        <div class="submit-holder">
                            <input type="submit" class="btn btn-large btn-primary" value="Gửi" />
                        </div>

                    }
                </div>
            </div>
        </div>
    </div>
</div>

